Optimal. Leaf size=135 \[ -\frac {i B c^3 x}{a^3}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {2 B c^3}{a^3 f (i-\tan (e+f x))^2}-\frac {4 i B c^3}{a^3 f (i-\tan (e+f x))}+\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 135, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.073, Rules used = {3669, 79, 45}
\begin {gather*} \frac {c^3 (-B+i A) (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {4 i B c^3}{a^3 f (-\tan (e+f x)+i)}-\frac {2 B c^3}{a^3 f (-\tan (e+f x)+i)^2}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {i B c^3 x}{a^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 79
Rule 3669
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^3}{(a+i a \tan (e+f x))^3} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^2}{(a+i a x)^4} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {(i B c) \text {Subst}\left (\int \frac {(c-i c x)^2}{(a+i a x)^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}-\frac {(i B c) \text {Subst}\left (\int \left (\frac {4 i c^2}{a^3 (-i+x)^3}+\frac {4 c^2}{a^3 (-i+x)^2}-\frac {i c^2}{a^3 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {i B c^3 x}{a^3}+\frac {B c^3 \log (\cos (e+f x))}{a^3 f}-\frac {2 B c^3}{a^3 f (i-\tan (e+f x))^2}-\frac {4 i B c^3}{a^3 f (i-\tan (e+f x))}+\frac {(i A-B) c^3 (1-i \tan (e+f x))^3}{6 a^3 f (1+i \tan (e+f x))^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.41, size = 145, normalized size = 1.07 \begin {gather*} \frac {c^3 \sec ^3(e+f x) (-3 i B \cos (e+f x)-\cos (3 (e+f x)) (A+i B-6 B f x-6 i B \log (\cos (e+f x)))+9 B \sin (e+f x)+i A \sin (3 (e+f x))-B \sin (3 (e+f x))+6 i B f x \sin (3 (e+f x))-6 B \log (\cos (e+f x)) \sin (3 (e+f x)))}{6 a^3 f (-i+\tan (e+f x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.28, size = 88, normalized size = 0.65
method | result | size |
derivativedivides | \(\frac {c^{3} \left (-\frac {-4 i A +8 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-5 i B -A}{-i+\tan \left (f x +e \right )}-B \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {4 i B +4 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}\right )}{f \,a^{3}}\) | \(88\) |
default | \(\frac {c^{3} \left (-\frac {-4 i A +8 B}{2 \left (-i+\tan \left (f x +e \right )\right )^{2}}-\frac {-5 i B -A}{-i+\tan \left (f x +e \right )}-B \ln \left (-i+\tan \left (f x +e \right )\right )-\frac {4 i B +4 A}{3 \left (-i+\tan \left (f x +e \right )\right )^{3}}\right )}{f \,a^{3}}\) | \(88\) |
risch | \(-\frac {B \,c^{3} {\mathrm e}^{-2 i \left (f x +e \right )}}{a^{3} f}+\frac {B \,c^{3} {\mathrm e}^{-4 i \left (f x +e \right )}}{2 a^{3} f}-\frac {c^{3} {\mathrm e}^{-6 i \left (f x +e \right )} B}{6 a^{3} f}+\frac {i c^{3} {\mathrm e}^{-6 i \left (f x +e \right )} A}{6 a^{3} f}-\frac {2 i B \,c^{3} x}{a^{3}}-\frac {2 i B \,c^{3} e}{a^{3} f}+\frac {B \,c^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )}{a^{3} f}\) | \(135\) |
norman | \(\frac {\frac {\left (i B \,c^{3}+A \,c^{3}\right ) \tan \left (f x +e \right )}{a f}+\frac {\left (5 i B \,c^{3}+A \,c^{3}\right ) \left (\tan ^{5}\left (f x +e \right )\right )}{a f}-\frac {-i c^{3} A +7 B \,c^{3}}{3 a f}-\frac {2 \left (-i B \,c^{3}+5 A \,c^{3}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 a f}-\frac {3 \left (-i c^{3} A +3 B \,c^{3}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{a f}-\frac {\left (2 i c^{3} A +6 B \,c^{3}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{a f}-\frac {i c^{3} B x}{a}-\frac {3 i c^{3} B x \left (\tan ^{2}\left (f x +e \right )\right )}{a}-\frac {3 i c^{3} B x \left (\tan ^{4}\left (f x +e \right )\right )}{a}-\frac {i c^{3} B x \left (\tan ^{6}\left (f x +e \right )\right )}{a}}{a^{2} \left (1+\tan ^{2}\left (f x +e \right )\right )^{3}}-\frac {B \,c^{3} \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 a^{3} f}\) | \(276\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.16, size = 109, normalized size = 0.81 \begin {gather*} \frac {{\left (-12 i \, B c^{3} f x e^{\left (6 i \, f x + 6 i \, e\right )} + 6 \, B c^{3} e^{\left (6 i \, f x + 6 i \, e\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right ) - 6 \, B c^{3} e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, B c^{3} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (i \, A - B\right )} c^{3}\right )} e^{\left (-6 i \, f x - 6 i \, e\right )}}{6 \, a^{3} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.46, size = 258, normalized size = 1.91 \begin {gather*} - \frac {2 i B c^{3} x}{a^{3}} + \frac {B c^{3} \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a^{3} f} + \begin {cases} \frac {\left (- 12 B a^{6} c^{3} f^{2} e^{10 i e} e^{- 2 i f x} + 6 B a^{6} c^{3} f^{2} e^{8 i e} e^{- 4 i f x} + \left (2 i A a^{6} c^{3} f^{2} e^{6 i e} - 2 B a^{6} c^{3} f^{2} e^{6 i e}\right ) e^{- 6 i f x}\right ) e^{- 12 i e}}{12 a^{9} f^{3}} & \text {for}\: a^{9} f^{3} e^{12 i e} \neq 0 \\x \left (\frac {2 i B c^{3}}{a^{3}} + \frac {\left (A c^{3} - 2 i B c^{3} e^{6 i e} + 2 i B c^{3} e^{4 i e} - 2 i B c^{3} e^{2 i e} + i B c^{3}\right ) e^{- 6 i e}}{a^{3}}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 255 vs. \(2 (118) = 236\).
time = 0.98, size = 255, normalized size = 1.89 \begin {gather*} \frac {\frac {30 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a^{3}} - \frac {60 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a^{3}} + \frac {30 \, B c^{3} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a^{3}} + \frac {147 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} - 60 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 942 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} - 2445 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} + 200 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 3620 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} + 2445 \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 60 \, A c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 942 i \, B c^{3} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 147 \, B c^{3}}{a^{3} {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{6}}}{30 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.96, size = 149, normalized size = 1.10 \begin {gather*} -\frac {c^3\,\left (18\,B\,\mathrm {tan}\left (e+f\,x\right )-B\,7{}\mathrm {i}-A-B\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,3{}\mathrm {i}+3\,A\,{\mathrm {tan}\left (e+f\,x\right )}^2+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,15{}\mathrm {i}+B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\,9{}\mathrm {i}-3\,B\,{\mathrm {tan}\left (e+f\,x\right )}^3\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )+9\,B\,\mathrm {tan}\left (e+f\,x\right )\,\ln \left (-1-\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )\right )\,1{}\mathrm {i}}{3\,a^3\,f\,{\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}^3} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________